<!DOCTYPE HTML PUBLIC "-//ORA//DTD CD HTML 3.2//EN">
<HTML>
<HEAD>
<TITLE>[Chapter 10] Byte</TITLE>
<META NAME="author" CONTENT="Mark Grand">
<META NAME="date" CONTENT="Fri Aug  8 15:22:30 1997">
<META NAME="form" CONTENT="html">
<META NAME="metadata" CONTENT="dublincore.0.1">
<META NAME="objecttype" CONTENT="book part">
<META NAME="otheragent" CONTENT="gmat dbtohtml">
<META NAME="publisher" CONTENT="O'Reilly &amp; Associates, Inc.">
<META NAME="source" CONTENT="SGML">
<META NAME="subject" CONTENT="java">
<META NAME="title" CONTENT="Java Language Reference">
<META HTTP-EQUIV="Content-Script-Type" CONTENT="text/javascript">
</HEAD>
<body vlink="#551a8b" alink="#ff0000" text="#000000" bgcolor="#FFFFFF" link="#0000ee">

<DIV CLASS=htmlnav>
<H1><a href='index.htm'><IMG SRC="gifs/smbanner.gif"
     ALT="Java Language Reference" border=0></a></H1>
<table width=515 border=0 cellpadding=0 cellspacing=0>
<tr>
<td width=172 align=left valign=top><A HREF="ch10_01.htm"><IMG SRC="gifs/txtpreva.gif" ALT="Previous" border=0></A></td>
<td width=171 align=center valign=top><B><FONT FACE="ARIEL,HELVETICA,HELV,SANSERIF" SIZE="-1">Chapter 10<br>The java.lang Package</FONT></B></TD>
<td width=172 align=right valign=top><A HREF="ch10_03.htm"><IMG SRC="gifs/txtnexta.gif" ALT="Next" border=0></A></td>
</tr>
</table>

&nbsp;
<hr align=left width=515>
</DIV>
<DIV CLASS=refnamediv>
<H1>Byte</H1>

<H2>Name</H2>

Byte

</DIV>

<DIV CLASS=refsect1>
<h2 CLASS=refsect1><A CLASS="TITLE" NAME="ch10-REFSECT1-AUTOID.10">Synopsis</A></h2>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Class Name:<br>
<DD>

<P CLASS=para>
<tt CLASS=literal>java.lang.Byte</tt> 

<p>
<DT CLASS=varlistentry>Superclass:<br>
<DD>

<P CLASS=para>
<tt CLASS=literal>java.lang.Number</tt> 

<p>
<DT CLASS=varlistentry>Immediate Subclasses:<br>
<DD>

<P CLASS=para>
None 

<p>
<DT CLASS=varlistentry>Interfaces Implemented:<br>
<DD>

<P CLASS=para>
None 

<p>
<DT CLASS=varlistentry>Availability:<br>
<DD>

<P CLASS=para>
New as of JDK 1.1 </DL>
</DIV>

<DIV CLASS=refsect1>
<h2 CLASS=refsect1><A CLASS="TITLE" NAME="ch10-REFSECT1-AUTOID.11">Description</A></h2>

<P CLASS=para>
The <tt CLASS=literal>Byte</tt> class provides an object wrapper for a <tt CLASS=literal>byte</tt> 
value. This is useful when you need to treat a <tt CLASS=literal>byte</tt> value 
as an object. For example, there are a number of utility methods that take 
a reference to an <tt CLASS=literal>Object</tt> as one of their arguments. You 
cannot specify a <tt CLASS=literal>byte</tt> value for one of these arguments, 
but you can provide a reference to a <tt CLASS=literal>Byte</tt> object that 
encapsulates the <tt CLASS=literal>byte</tt> value. Furthermore, the <tt CLASS=literal>Byte</tt> 
class is necessary as of JDK 1.1 to support the Reflection API and class
literals.

<P CLASS=para>
The <tt CLASS=literal>Byte</tt> class also provides a number of utility methods 
for converting <tt CLASS=literal>byte</tt> values to other primitive types and 
for converting <tt CLASS=literal>byte</tt> values to strings and vice versa. 

</DIV>

<DIV CLASS=refsect1>
<h2 CLASS=refsect1><A CLASS="TITLE" NAME="ch10-REFSECT1-AUTOID.12">Class Summary</A></h2>

<DIV CLASS=screen>
<P>
<PRE>
public final class java.lang.Byte extends java.lang.Number {
  // Constants
  public static final byte MAX_VALUE;
  public static final byte MIN_VALUE;
  public static final Class TYPE;
  // Constructors
  public Byte(byte value);
  public Byte(String s);
  // Class Methods
  public static Byte decode(String nm);
  public static byte parseByte(String s);
  public static byte parseByte(String s, int radix);
  public static String toString(byte b);
  public static Byte valueOf(String s, int radix);
  public static Byte valueOf(String s);
  // Instance Methods
  public byte byteValue(); 
  public double doubleValue;
  public boolean equals(Object obj);
  public float floatValue
  public int hashCode();
  public int intValue();
  public long longValue();
  public short shortValue();
  public String toString();
}
</PRE>
</DIV>

</DIV>

<DIV CLASS=refsect1>
<h2 CLASS=refsect1><A CLASS="TITLE" NAME="ch10-REFSECT1-AUTOID.13">Constants</A></h2>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="ch10-REFSECT2-AUTOID.11">MAX_VALUE</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="ch10-REFSECT3-AUTOID.12">public static final byte MAX_VALUE= 127</A></h4>

<P CLASS=para>
The largest value that can be represented by a <tt CLASS=literal>byte</tt>. 

</DIV>

</DIV>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="ch10-REFSECT2-AUTOID.12">MIN_VALUE</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="ch10-REFSECT3-AUTOID.13">public static final byte MIN_VALUE= -128</A></h4>

<P CLASS=para>
The smallest value that can be represented by a <tt CLASS=literal>byte</tt>. 

</DIV>

</DIV>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="ch10-REFSECT2-AUTOID.13">TYPE</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="ch10-REFSECT3-AUTOID.14">public static final Class TYPE</A></h4>

<P CLASS=para>
The <tt CLASS=literal>Class</tt> object that represents 
the primitive type <tt CLASS=literal>byte</tt>. 
It is always true that <tt CLASS=literal>Byte.TYPE</tt> 
<tt CLASS=literal>==</tt> <tt CLASS=literal>byte.class</tt>.

</DIV>

</DIV>

</DIV>

<DIV CLASS=refsect1>
<h2 CLASS=refsect1><A CLASS="TITLE" NAME="ch10-REFSECT1-AUTOID.14">Constructors</A></h2>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="ch10-REFSECT2-AUTOID.14">Byte</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="ch10-REFSECT3-AUTOID.15">public Byte(byte value)</A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Parameters<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><tt CLASS=literal>value</tt><br>
<DD>

<P CLASS=para>
The <tt CLASS=literal>byte</tt> 
value to be encapsulated by this object. </DL>
<p>
<DT CLASS=varlistentry>Description<br>
<DD>

<P CLASS=para>
Creates a <tt CLASS=literal>Byte</tt> object with the specified byte 
value. </DL>
</DIV>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="ch10-REFSECT3-AUTOID.16">public Byte(String s) throws NumberFormatException</A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Parameters<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><tt CLASS=literal>s</tt><br>
<DD>

<P CLASS=para>
The string to be made 
into a <tt CLASS=literal>Byte</tt> object. </DL>
<p>
<DT CLASS=varlistentry>Throws<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><tt CLASS=literal>NumberFormatException</tt><br>
<DD>

<P CLASS=para>
If the sequence of characters in the given <tt CLASS=literal>String</tt> does 
not form a valid <tt CLASS=literal>byte</tt> literal. </DL>
<p>
<DT CLASS=varlistentry>Description<br>
<DD>

<P CLASS=para>
Constructs a <tt CLASS=literal>Byte</tt> object with the value specified by 
the given string. The string should consist of one or more digit characters.
The digit characters can be preceded by a single `-' character.
If the string contains any other characters, the constructor 
throws a <tt CLASS=literal>NumberFormatException</tt>.</DL>
</DIV>

</DIV>

</DIV>

<DIV CLASS=refsect1>
<h2 CLASS=refsect1><A CLASS="TITLE" NAME="ch10-REFSECT1-AUTOID.15">Class Methods</A></h2>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="ch10-REFSECT2-AUTOID.15">decode</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="ch10-REFSECT3-AUTOID.17">public static Byte decode(String nm) throws NumberFormatException</A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Parameters<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><tt CLASS=literal>nm</tt><br>
<DD>

<P CLASS=para>
A <tt CLASS=literal>String</tt> representation of the value to be 
encapsulated by a <tt CLASS=literal>Byte</tt> object. If the 
string begins with <tt CLASS=literal>#</tt> or 
<tt CLASS=literal>0x</tt>, it is a radix 16 representation of the value.  
If the string begins with <tt CLASS=literal>0</tt>, it is a radix 
8 representation of the value. Otherwise, it is assumed to be a 
radix 10 representation of the value.</DL>
<p>
<DT CLASS=varlistentry>Returns<br>
<DD>

<P CLASS=para>
A <tt CLASS=literal>Byte</tt> object that encapsulates the given value.

<p>
<DT CLASS=varlistentry>Throws<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><tt CLASS=literal>NumberFormatException</tt><br>
<DD>

<P CLASS=para>
If the <tt CLASS=literal>String</tt> contains any non-digit characters 
other than a leading minus sign or the value represented by the 
<tt CLASS=literal>String</tt> is less than <tt CLASS=literal>Byte.MIN_VALUE</tt>
or greater than <tt CLASS=literal>Byte.MAX_VALUE</tt>.</DL>
<p>
<DT CLASS=varlistentry>Description<br>
<DD>

<P CLASS=para>
This method returns a <tt CLASS=literal>Byte</tt> 
object that encapsulates the given value.</DL>
</DIV>

</DIV>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="ch10-REFSECT2-AUTOID.16">parseByte</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="ch10-REFSECT3-AUTOID.18">public static byte parseByte(String s) throws NumberFormatException</A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Parameters<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><tt CLASS=literal>s</tt><br>
<DD>

<P CLASS=para>
The <tt CLASS=literal>String</tt> 
to be converted to a <tt CLASS=literal>byte</tt> value. </DL>
<p>
<DT CLASS=varlistentry>Returns<br>
<DD>

<P CLASS=para>
The numeric value of the byte represented by the <tt CLASS=literal>String</tt> 
object. 

<p>
<DT CLASS=varlistentry>Throws<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><tt CLASS=literal>NumberFormatException</tt><br>
<DD>

<P CLASS=para>
If the <tt CLASS=literal>String</tt> does not contain a valid representation 
of a <tt CLASS=literal>byte</tt> or the value represented by the 
<tt CLASS=literal>String</tt> is less than <tt CLASS=literal>Byte.MIN_VALUE</tt>
or greater than <tt CLASS=literal>Byte.MAX_VALUE</tt>.</DL>
<p>
<DT CLASS=varlistentry>Description<br>
<DD>

<P CLASS=para>
This method returns the numeric value of the <tt CLASS=literal>byte</tt> 
represented by the contents of the given <tt CLASS=literal>String</tt> object. 
The <tt CLASS=literal>String</tt> must contain only decimal digits, except that 
the first character may be a minus sign. </DL>
</DIV>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="ch10-REFSECT3-AUTOID.19"><DIV CLASS=screen> <P> <PRE> public static byte parseByte(String s, int radix) throws NumberFormatException </PRE> </DIV></A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Parameters<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><tt CLASS=literal>s</tt><br>
<DD>

<P CLASS=para>
The <tt CLASS=literal>String</tt> to be converted to a <tt CLASS=literal>byte</tt> value.

<p>
<DT CLASS=varlistentry><tt CLASS=literal>radix</tt><br>
<DD>

<P CLASS=para>
The radix used in interpreting the characters in the
<tt CLASS=literal>String</tt> as digits. This value must be in the range
<tt CLASS=literal>Character.MIN_RADIX</tt> to
<tt CLASS=literal>Character.MAX_RADIX</tt>. If <tt CLASS=literal>radix</tt> is
in the range 2 through 10, only characters for which the
<tt CLASS=literal>Character.isDigit()</tt> method returns <tt CLASS=literal>true</tt> are
considered to be valid digits. If <tt CLASS=literal>radix</tt> is in the
range 11 through 36, characters in the ranges `A' 
through `Z' and `a'
through `z' may be considered valid digits.</DL>
<p>
<DT CLASS=varlistentry>Returns<br>
<DD>

<P CLASS=para>
The numeric value of the byte represented by the <tt CLASS=literal>String</tt> 
object in the specified radix. 

<p>
<DT CLASS=varlistentry>Throws<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><tt CLASS=literal>NumberFormatException</tt><br>
<DD>

<P CLASS=para>
If the <tt CLASS=literal>String</tt> does not contain a valid representation 
of a <tt CLASS=literal>byte</tt>, <tt CLASS=literal>radix</tt> 
is not in the appropriate range, or 
the value represented by the 
<tt CLASS=literal>String</tt> is less than <tt CLASS=literal>Byte.MIN_VALUE</tt>
or greater than <tt CLASS=literal>Byte.MAX_VALUE</tt>.</DL>
<p>
<DT CLASS=varlistentry>Description<br>
<DD>

<P CLASS=para>
This method returns the numeric value of the <tt CLASS=literal>byte</tt> 
represented by the contents of the given <tt CLASS=literal>String</tt> object 
in the specified radix. The <tt CLASS=literal>String</tt> must contain only 
valid digits of the specified radix, except that the first character may 
be a minus sign. The digits are parsed in the specified radix to produce 
the numeric value. </DL>
</DIV>

</DIV>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="ch10-REFSECT2-AUTOID.17">toString</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="ch10-REFSECT3-AUTOID.20">public String toString(byte b)</A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Parameters<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><tt CLASS=literal>b</tt><br>
<DD>

<P CLASS=para>
The <tt CLASS=literal>byte</tt> 
value to be converted to a string. </DL>
<p>
<DT CLASS=varlistentry>Returns<br>
<DD>

<P CLASS=para>
The string representation of the given value. 

<p>
<DT CLASS=varlistentry>Description<br>
<DD>

<P CLASS=para>
This method returns a <tt CLASS=literal>String</tt> object that contains the 
decimal representation of the given value.

<P CLASS=para>
This method returns a string that begins with `-' if the given 
value is negative. The rest of the string is a sequence of one or more 
of the characters `0', `1', `2', `3', 
`4', `5', `6', `7', `8', 
and `9'. This method returns "0" if its argument 
is <tt CLASS=literal>0</tt>. Otherwise, the string returned by this method does 
not begin with "0" or "-0". </DL>
</DIV>

</DIV>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="ch10-REFSECT2-AUTOID.18">valueOf</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="ch10-REFSECT3-AUTOID.21">public static Byte valueOf(String s) throws NumberFormatException</A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Parameters<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><tt CLASS=literal>s</tt><br>
<DD>

<P CLASS=para>
The string to be made 
into a <tt CLASS=literal>Byte</tt> object. </DL>
<p>
<DT CLASS=varlistentry>Returns<br>
<DD>

<P CLASS=para>
The <tt CLASS=literal>Byte</tt> object constructed from the string. 

<p>
<DT CLASS=varlistentry>Throws<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><tt CLASS=literal>NumberFormatException</tt><br>
<DD>

<P CLASS=para>
If the <tt CLASS=literal>String</tt> does not contain a valid representation 
of a <tt CLASS=literal>byte</tt> or 
the value represented by the 
<tt CLASS=literal>String</tt> is less than <tt CLASS=literal>Byte.MIN_VALUE</tt>
or greater than <tt CLASS=literal>Byte.MAX_VALUE</tt>.</DL>
<p>
<DT CLASS=varlistentry>Description<br>
<DD>

<P CLASS=para>
Constructs a <tt CLASS=literal>Byte</tt> object with the value specified by 
the given string. The string should consist of one or 
more digit characters. The digit characters can be preceded by a 
single `-' character. If the string contains any 
other characters, the 
method throws a <tt CLASS=literal>NumberFormatException</tt>.</DL>
</DIV>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="ch10-REFSECT3-AUTOID.22"><DIV CLASS=screen> <P> <PRE> public static Byte valueOf(String s, int radix) throws NumberFormatException </PRE> </DIV></A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Parameters<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><tt CLASS=literal>s</tt><br>
<DD>

<P CLASS=para>
The string to be made into a <tt CLASS=literal>Byte</tt> object.

<p>
<DT CLASS=varlistentry><tt CLASS=literal>radix</tt><br>
<DD>

<P CLASS=para>
The radix used in converting the string to 
a value. This value must be in the range <tt CLASS=literal>Character.MIN_RADIX</tt> 
to <tt CLASS=literal>Character.MAX_RADIX</tt>. </DL>
<p>
<DT CLASS=varlistentry>Returns<br>
<DD>

<P CLASS=para>
The <tt CLASS=literal>Byte</tt> object constructed from the string. 

<p>
<DT CLASS=varlistentry>Throws<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><tt CLASS=literal>NumberFormatException</tt><br>
<DD>

<P CLASS=para>
If the <tt CLASS=literal>String</tt> does not contain a valid representation 
of a <tt CLASS=literal>byte</tt>, radix 
is not in the appropriate range, or 
the value represented by the 
<tt CLASS=literal>String</tt> is less than <tt CLASS=literal>Byte.MIN_VALUE</tt>
or greater than <tt CLASS=literal>Byte.MAX_VALUE</tt>.</DL>
<p>
<DT CLASS=varlistentry>Description<br>
<DD>

<P CLASS=para>
Constructs a <tt CLASS=literal>Byte</tt> object with the value
specified by the given string in the specified radix. 
The string should consist of one or more digit characters or 
characters in the range `A' to `Z' 
or `a' to `z' that are considered 
digits in the given radix. The digit characters can be preceded 
by a single `-' character. If the string contains any other 
characters, the method throws a <tt CLASS=literal>NumberFormatException</tt>.</DL>
</DIV>

</DIV>

</DIV>

<DIV CLASS=refsect1>
<h2 CLASS=refsect1><A CLASS="TITLE" NAME="ch10-REFSECT1-AUTOID.16">Instance Methods</A></h2>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="ch10-REFSECT2-AUTOID.19">byteValue</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="ch10-REFSECT3-AUTOID.23">public byte byteValue()</A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Returns<br>
<DD>

<P CLASS=para>
The value of this object as a <tt CLASS=literal>byte</tt>. 

<p>
<DT CLASS=varlistentry>Overrides<br>
<DD>

<P CLASS=para>
<tt CLASS=literal>Number.byteValue()</tt> 

<p>
<DT CLASS=varlistentry>Description<br>
<DD>

<P CLASS=para>
This method returns the value of this object as a <tt CLASS=literal>byte</tt>. </DL>
</DIV>

</DIV>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="ch10-REFSECT2-AUTOID.20">doubleValue</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="ch10-REFSECT3-AUTOID.24">public double doubleValue()</A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Returns<br>
<DD>

<P CLASS=para>
The value of this object as a <tt CLASS=literal>double</tt>. 

<p>
<DT CLASS=varlistentry>Overrides<br>
<DD>

<P CLASS=para>
<tt CLASS=literal>Number.doubleValue()</tt> 

<p>
<DT CLASS=varlistentry>Description<br>
<DD>

<P CLASS=para>
This method returns the value of this object as a <tt CLASS=literal>double</tt>. </DL>
</DIV>

</DIV>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="ch10-REFSECT2-AUTOID.21">equals</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="ch10-REFSECT3-AUTOID.25">public boolean equals(Object obj)</A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Parameters<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><tt CLASS=literal>obj</tt><br>
<DD>

<P CLASS=para>
The object to be compared 
with this object. </DL>
<p>
<DT CLASS=varlistentry>Returns<br>
<DD>

<P CLASS=para>
<tt CLASS=literal>true</tt> if the objects are equal; 
<tt CLASS=literal>false</tt> if they are not. 

<p>
<DT CLASS=varlistentry>Overrides<br>
<DD>

<P CLASS=para>
<tt CLASS=literal>Object.equals()</tt> 

<p>
<DT CLASS=varlistentry>Description<br>
<DD>

<P CLASS=para>
This method returns <tt CLASS=literal>true</tt> if 
<tt CLASS=literal>obj</tt> is an instance of <tt CLASS=literal>Byte</tt> 
and it contains the same value as the object this method is associated 
with. </DL>
</DIV>

</DIV>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="ch10-REFSECT2-AUTOID.22">floatValue</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="ch10-REFSECT3-AUTOID.26">public float floatValue()</A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Returns<br>
<DD>

<P CLASS=para>
The value of this object as a <tt CLASS=literal>float</tt>. 

<p>
<DT CLASS=varlistentry>Overrides<br>
<DD>

<P CLASS=para>
<tt CLASS=literal>Number.floatValue()</tt>

<p>
<DT CLASS=varlistentry>Description<br>
<DD>

<P CLASS=para>
This method returns the value of this object as a <tt CLASS=literal>float</tt>. </DL>
</DIV>

</DIV>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="ch10-REFSECT2-AUTOID.23">hashCode</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="ch10-REFSECT3-AUTOID.27">public int hashCode()</A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Returns<br>
<DD>

<P CLASS=para>
A hashcode based on the <tt CLASS=literal>byte</tt> 
value of the object. 

<p>
<DT CLASS=varlistentry>Overrides<br>
<DD>

<P CLASS=para>
<tt CLASS=literal>Object.hashCode()</tt> 

<p>
<DT CLASS=varlistentry>Description<br>
<DD>

<P CLASS=para>
This method returns a hashcode computed from the value of this object. </DL>
</DIV>

</DIV>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="ch10-REFSECT2-AUTOID.24">intValue</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="ch10-REFSECT3-AUTOID.28">public int intValue()</A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Returns<br>
<DD>

<P CLASS=para>
The value of this object as an <tt CLASS=literal>int</tt>. 

<p>
<DT CLASS=varlistentry>Overrides<br>
<DD>

<P CLASS=para>
<tt CLASS=literal>Number.intValue()</tt> 

<p>
<DT CLASS=varlistentry>Description<br>
<DD>

<P CLASS=para>
This method returns the value of this object as an <tt CLASS=literal>int</tt>. </DL>
</DIV>

</DIV>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="ch10-REFSECT2-AUTOID.25">longValue</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="ch10-REFSECT3-AUTOID.29">public long longValue()</A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Returns<br>
<DD>

<P CLASS=para>
The value of this object as a <tt CLASS=literal>long</tt>. 

<p>
<DT CLASS=varlistentry>Overrides<br>
<DD>

<P CLASS=para>
<tt CLASS=literal>Number.longValue()</tt>

<p>
<DT CLASS=varlistentry>Description<br>
<DD>

<P CLASS=para>
This method returns the value of this object as a <tt CLASS=literal>long</tt>. </DL>
</DIV>

</DIV>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="ch10-REFSECT2-AUTOID.26">shortValue</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="ch10-REFSECT3-AUTOID.30">public short shortValue()</A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Returns<br>
<DD>

<P CLASS=para>
The value of this object as a <tt CLASS=literal>short</tt>. 

<p>
<DT CLASS=varlistentry>Overrides<br>
<DD>

<P CLASS=para>
<tt CLASS=literal>Number.shortValue()</tt> 

<p>
<DT CLASS=varlistentry>Description<br>
<DD>

<P CLASS=para>
This method returns the value of this object as a <tt CLASS=literal>short</tt>. </DL>
</DIV>

</DIV>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="ch10-REFSECT2-AUTOID.27">toString</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="ch10-REFSECT3-AUTOID.31">public String toString()</A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Returns<br>
<DD>

<P CLASS=para>
The string representation of the value of this object. 

<p>
<DT CLASS=varlistentry>Overrides<br>
<DD>

<P CLASS=para>
<tt CLASS=literal>Object.toString()</tt> 

<p>
<DT CLASS=varlistentry>Description<br>
<DD>

<P CLASS=para>
This method returns a <tt CLASS=literal>String</tt> object that contains the 
decimal representation of the value of this object.

<P CLASS=para>
This method returns a string that begins with `-` if the given 
value is negative. The rest of the string is a sequence of one or more 
of the characters `0', `1', `2', `3', 
`4', `5', `6', `7', `8', 
and `9'. This method returns "0" if its argument 
is <tt CLASS=literal>0</tt>. Otherwise, the string returned by this method does 
not begin with "0" or "-0". </DL>
</DIV>

</DIV>

</DIV>

<DIV CLASS=refsect1>
<h2 CLASS=refsect1><A CLASS="TITLE" NAME="ch10-REFSECT1-AUTOID.17">Inherited Methods</A></h2>

<DIV CLASS=informaltable>
<P>
<TABLE CLASS=INFORMALTABLE>
<TR CLASS=row>
<TH ALIGN="left">

<P CLASS=para>
Method</TH>
<TH ALIGN="left">

<P CLASS=para>
Inherited From</TH>
<TH ALIGN="left">

<P CLASS=para>
Method</TH>
<TH ALIGN="left">

<P CLASS=para>
Inherited From</TH>
</TR>
<TR CLASS=row>
<TD ALIGN="left">

<P CLASS=para>
<tt CLASS=literal>clone()</tt></TD>
<TD ALIGN="left">

<P CLASS=para>
<tt CLASS=literal>Object</tt></TD>
<TD ALIGN="left">

<P CLASS=para>
<tt CLASS=literal>finalize()</tt></TD>
<TD ALIGN="left">

<P CLASS=para>
<tt CLASS=literal>Object</tt></TD>
</TR>
<TR CLASS=row>
<TD ALIGN="left">

<P CLASS=para>
<tt CLASS=literal>getClass()</tt></TD>
<TD ALIGN="left">

<P CLASS=para>
<tt CLASS=literal>Object</tt></TD>
<TD ALIGN="left">

<P CLASS=para>
<tt CLASS=literal>notify()</tt></TD>
<TD ALIGN="left">

<P CLASS=para>
<tt CLASS=literal>Object</tt></TD>
</TR>
<TR CLASS=row>
<TD ALIGN="left">

<P CLASS=para>
<tt CLASS=literal>notifyAll()</tt></TD>
<TD ALIGN="left">

<P CLASS=para>
<tt CLASS=literal>Object</tt></TD>
<TD ALIGN="left">

<P CLASS=para>
<tt CLASS=literal>wait()</tt></TD>
<TD ALIGN="left">

<P CLASS=para>
<tt CLASS=literal>Object</tt></TD>
</TR>
<TR CLASS=row>
<TD ALIGN="left">

<P CLASS=para>
<tt CLASS=literal>wait(long)</tt></TD>
<TD ALIGN="left">

<P CLASS=para>
<tt CLASS=literal>Object</tt></TD>
<TD ALIGN="left">

<P CLASS=para>
<tt CLASS=literal>wait(long, int)</tt></TD>
<TD ALIGN="left">

<P CLASS=para>
<tt CLASS=literal>Object</tt></TD>
</TR>
</TABLE>
<P>
</DIV>

</DIV>

<DIV CLASS=refsect1>
<h2 CLASS=refsect1><A CLASS="TITLE" NAME="ch10-REFSECT1-AUTOID.18">See Also</A></h2>

<P CLASS=para>
<A HREF="ch10_03.htm">Character</A>;
<A HREF="ch10_04.htm">Class</A>;
<A HREF="ch10_08.htm">Double</A>;
<A HREF="ch09_04.htm#JLR2-CH-9-SECT-4.1">Exceptions</A>;
<A HREF="ch10_09.htm">Float</A>;
<A HREF="ch02_02.htm#JLR2-CH-2-SECT-2.3.1">Integer literals</A>;
<A HREF="ch03_01.htm#JLR2-CH-3-SECT-1.1.1">Integer types</A>;
<A HREF="ch10_10.htm">Integer</A>;
<A HREF="ch10_11.htm">Long</A>;
<A HREF="ch10_13.htm">Number</A>;
<A HREF="ch10_19.htm">Short</A>;
<A HREF="ch10_20.htm">String</A>

</DIV>


<DIV CLASS=htmlnav>

<P>
<HR align=left width=515>
<table width=515 border=0 cellpadding=0 cellspacing=0>
<tr>
<td width=172 align=left valign=top><A HREF="ch10_01.htm"><IMG SRC="gifs/txtpreva.gif" ALT="Previous" border=0></A></td>
<td width=171 align=center valign=top><a href="index.htm"><img src='gifs/txthome.gif' border=0 alt='Home'></a></td>
<td width=172 align=right valign=top><A HREF="ch10_03.htm"><IMG SRC="gifs/txtnexta.gif" ALT="Next" border=0></A></td>
</tr>
<tr>
<td width=172 align=left valign=top>Boolean</td>
<td width=171 align=center valign=top><a href="index/idx_0.htm"><img src='gifs/index.gif' alt='Book Index' border=0></a></td>
<td width=172 align=right valign=top>Character</td>
</tr>
</table>
<hr align=left width=515>

<IMG SRC="gifs/smnavbar.gif" USEMAP="#map" BORDER=0> 
<MAP NAME="map"> 
<AREA SHAPE=RECT COORDS="0,0,108,15" HREF="../javanut/index.htm"
alt="Java in a Nutshell"> 
<AREA SHAPE=RECT COORDS="109,0,200,15" HREF="../langref/index.htm" 
alt="Java Language Reference"> 
<AREA SHAPE=RECT COORDS="203,0,290,15" HREF="../awt/index.htm" 
alt="Java AWT"> 
<AREA SHAPE=RECT COORDS="291,0,419,15" HREF="../fclass/index.htm" 
alt="Java Fundamental Classes"> 
<AREA SHAPE=RECT COORDS="421,0,514,15" HREF="../exp/index.htm" 
alt="Exploring Java"> 
</MAP>
</DIV>

</BODY>
</HTML>
